package com.wh.wisdomsite.xbox.vi.service.impl;

import com.baomidou.mybatisplus.mapper.SqlHelper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.wh.wisdomsite.xbox.vi.dao.VideoProjectMapper;
import com.wh.wisdomsite.xbox.vi.entity.VideoProject;
import com.wh.wisdomsite.xbox.vi.service.IVideoProjectService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.Map;

/***
 *视频设备项目ServiceImpl
 * @author 杨世强
 * @date 16:26 2018/8/2
 * @Copyright 公司版权所有
 * @Company 贵州万华科技有限公司Copyright (c) 2016
 * @version V1.0
 */
@Service("videoProjectService")
@Transactional(rollbackFor = {Exception.class,RuntimeException.class})
public class VideoProjectServiceImpl extends ServiceImpl<VideoProjectMapper,VideoProject> implements IVideoProjectService {

      private static final Log logger = LogFactory.getLog(VideoProjectServiceImpl.class);

      @Autowired
      private VideoProjectMapper videoProjectMapper;

      @Override
      public Map<String, Object> getMapById(Serializable id) {
       return videoProjectMapper.getMapById(id);
      }

      @Override
      public Page<Map<String, Object>> getMapsPage(Page page, Wrapper<VideoProject> wrapper) {
       SqlHelper.fillWrapper(page, wrapper);
       page.setRecords(this.baseMapper.getMapsPage(page, wrapper));
       return page;
      }

      @Override
      public Map<String, Object> getPrjMapById(Serializable id) {
       return videoProjectMapper.getPrjMapById(id);
      }

      @Override
      public Page<Map<String, Object>> getPrjMapsPage(Page page, Wrapper<VideoProject> wrapper) {
       SqlHelper.fillWrapper(page, wrapper);
       page.setRecords(this.baseMapper.getPrjMapsPage(page, wrapper));
       return page;
      }

    @Override
    public Map<String, Object> getTotal(Wrapper<VideoProject> var1) {
        return videoProjectMapper.getTotal(var1);
    }


}

